package cn.ad.server.web.spring.service.actions.command;

import cn.ad.server.domain.enumration.OS;

/**
 * 包装信息。供targetUrl用。
 * @author wangwei
 *
 */
public class TrackCommand{

	
//	os={os}&mac={mac}&mac_md5={mac_md5}&idfa={idfa}
//	&idfa_md5={idfa_md5}&imei={imei}&imei_md5={imei_md5}&
//	androidid={androidid}&androidid_md5={androidid_md5}
//	&aid={aid}&sid={sid}&cid={cid}&mid={mid}&guid={guid}
	
	
	private int os;
	private String mac;
	private String mac_md5;
	private String idfa;
	
	private String idfa_md5;
	private String imei;
	private String imei_md5;
	
	private String androidid;
	private String androidid_md5;
	
	private String ch;
	
	private long aid;
	private long sid;
	private long cid;
	private long mid;
	private String guid;
	
	private String advertising_id;
	
	
	
	
	public String getOsName() {
		if(this.os==0){
			return "";
		}else{
			return OS.osMap.get(this.os).getName();
		}
	}
	public int getOs() {
		return os;
	}
	public void setOs(int os) {
		this.os = os;
	}
	public String getMac() {
		return mac;
	}
	public void setMac(String mac) {
		this.mac = mac;
	}
	public String getMac_md5() {
		return mac_md5;
	}
	public void setMac_md5(String mac_md5) {
		this.mac_md5 = mac_md5;
	}
	public String getIdfa() {
		return idfa;
	}
	public void setIdfa(String idfa) {
		this.idfa = idfa;
	}
	public String getIdfa_md5() {
		return idfa_md5;
	}
	public void setIdfa_md5(String idfa_md5) {
		this.idfa_md5 = idfa_md5;
	}
	public String getImei() {
		return imei;
	}
	public void setImei(String imei) {
		this.imei = imei;
	}
	public String getImei_md5() {
		return imei_md5;
	}
	public void setImei_md5(String imei_md5) {
		this.imei_md5 = imei_md5;
	}
	public String getAndroidid() {
		return androidid;
	}
	public void setAndroidid(String androidid) {
		this.androidid = androidid;
	}
	public String getAndroidid_md5() {
		return androidid_md5;
	}
	public void setAndroidid_md5(String androidid_md5) {
		this.androidid_md5 = androidid_md5;
	}
	public long getAid() {
		return aid;
	}
	public void setAid(long aid) {
		this.aid = aid;
	}
	public long getSid() {
		return sid;
	}
	public void setSid(long sid) {
		this.sid = sid;
	}
	public long getCid() {
		return cid;
	}
	public void setCid(long cid) {
		this.cid = cid;
	}
	public long getMid() {
		return mid;
	}
	public void setMid(long mid) {
		this.mid = mid;
	}
	public String getGuid() {
		return guid;
	}
	public void setGuid(String guid) {
		this.guid = guid;
	}
	
	public String getCh() {
		return ch;
	}
	public void setCh(String ch) {
		this.ch = ch;
	}
	
	public String getAdvertising_id() {
		return advertising_id;
	}
	public void setAdvertising_id(String advertising_id) {
		this.advertising_id = advertising_id;
	}
	/**
	 * 将设备信息生成url格式
	 * @return
	 */
	public String toUrlDeviceInfo() {
		StringBuilder builder = new StringBuilder();
		builder.append("os=").append(os);
		builder.append("&mac=").append(mac);
		builder.append("&mac_md5=").append(mac_md5);
		builder.append("&idfa=").append(idfa);
		builder.append("&idfa_md5=").append(idfa_md5);
		builder.append("&imei=").append(imei);
		builder.append("&imei_md5=").append(imei_md5);
		builder.append("&androidid=").append(androidid);
		builder.append("&androidid_md5=").append(androidid_md5);
		builder.append("&ch=").append("");
		return builder.toString();
	}
	
	@Override
	public String toString() {
		return "TrackCommand [os=" + os + ", mac=" + mac + ", mac_md5=" + mac_md5 + ", idfa=" + idfa + ", idfa_md5="
				+ idfa_md5 + ", imei=" + imei + ", imei_md5=" + imei_md5 + ", androidid=" + androidid
				+ ", androidid_md5=" + androidid_md5 + ", ch=" + ch + ", aid=" + aid + ", sid=" + sid + ", cid=" + cid
				+ ", mid=" + mid + ", guid=" + guid + "]";
	}
	
}
